//
//  BIDApplyAndReportViewController.m
//  JuanChengOA
//
//  Created by mal on 2017/7/26.
//  Copyright © 2017年 mal. All rights reserved.
//

#import "BIDApplyAndReportViewController.h"
#import "BIDApplyListViewController.h"

@interface BIDApplyAndReportViewController ()

@end

@implementation BIDApplyAndReportViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"请示报告";
    _menuArr = @[@{@"title":@"请示管理", @"imgName":@"noticeManage.png"},
                 @{@"title":@"报告管理", @"imgName":@"activityManage.png"}];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self refreshBadge];
}

- (void)pushNotificationHandler
{
    [self refreshBadge];
}

//刷新角标
- (void)refreshBadge
{
    NSDictionary *dictionary1 = [[NSDictionary alloc] initWithObjectsAndKeys:@1, @"index", @"requestAndroid!gainNotReview.action", @"url", nil];
    NSDictionary *dictionary2 = [[NSDictionary alloc] initWithObjectsAndKeys:@2, @"index", @"requestAndroid!gainNotReview.action", @"url", nil];
    
    NSArray *arr = [[NSArray alloc] initWithObjects:dictionary1, dictionary2, nil];
    [self getCornerMarkCount:arr];
}

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    NSUInteger index = [indexPath row];
    BIDApplyListViewController *vc = nil;
    vc = [[BIDApplyListViewController alloc] init];
    switch (index)
    {
        case 0:
        {
            //请示管理
            vc.isApply = YES;
            vc.title = @"请示管理";
        }
            break;
        case 1:
        {
            //报告管理
            vc.isApply = NO;
            vc.title = @"报告管理";
        }
            break;
    }
    if(vc)
    {
        [self.navigationController pushViewController:vc animated:YES];
    }
}

@end
